import React from 'react';
import Bundle from './bundle';
import {Spin} from 'antd';
const Loading = function () {return <div style={{textAlign:'center',paddingTop: '10%'}}><Spin size="large" /></div>}

const createComponent = (component) => props => {
  return (
    <Bundle load={component}>
      {
        (Component) => Component ? <Component {...props}/> : <Loading/>
      }
    </Bundle>
  )
}

export default createComponent;
